<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script >

       /* //  do/while循环
        let i=0,sub=0;
        do{
            i++;
            sub = i * 400;
            alert("跑完第"+i+"圈，共计"+sub+"米");
            let  an=prompt("你还能跑吗？");
            if (an==="不能"){
                break;
            }

        }while (1);
        document.write("跑完第"+i+"圈，共计"+sub+"米")*/

        //  while循环
        let i=0,sub=0;
       outer:
        while (1){
            alert("跑完第"+i+"圈，共计"+sub+"米");
            i++;
            sub=i*400;
            let an=prompt("还能跑吗");
            if (an==="能"){
                continue;
            }else {
                if (an==="不能") {
                    break ;
                }else {
                    alert("到底能不能");
                    continue outer //回到prompt
                }
            }

        }
        document.write("跑完第"+i+"圈，共计"+sub+"米")
    </script>
</head>
<body>

</body>
</html>